<h2>thread_info</h2>
<hr>
<p>
<strong>Function</strong> - Return information about a thread.
<h3>SYNOPSIS</h3>
<pre>
<strong>kern_return_t   thread_info</strong>
                <strong>(thread_act_t</strong>                     <var>target_thread</var>,
                 <strong>thread_flavor_t</strong>                         <var>flavor</var>,
                 <strong>thread_info_t</strong>                      <var>thread_info</var>,
                 <strong>mach_msg_type_number_t</strong>       <var>thread_info_count</var><strong>);</strong>
</pre>
<h3>PARAMETERS</h3>
<dl>
<p>
<dt> <var>target_thread</var> 
<dd>
[in thread send right]
The thread for which the information is to be
returned.
<p>
<dt> <var>flavor</var> 
<dd>
[in scalar]
The type of information to be returned.  Valid values are:
<dl>
<p>
<dt> <strong>THREAD_BASIC_INFO</strong>
<dd>
Returns basic information about the thread, such as the 
thread's run state and suspend count.  The returned structure is 
<strong>thread_basic_info</strong>.
<p>
<dt> <strong>THREAD_SCHED_FIFO_INFO</strong>
<dd>
Returns FIFO scheduling policy information about the thread. 
The returned structure is <strong>policy_fifo_info</strong>.
<p>
<dt> <strong>THREAD_SCHED_RR_INFO</strong>
<dd>
Returns round-robin scheduling policy information about the 
thread.  The returned structure is <strong>policy_rr_info</strong>.
<p>
<dt> <strong>THREAD_SCHED_TIMESHARE_INFO</strong>
<dd>
Returns timeshare scheduling policy information about the 
thread.  The returned structure is <strong>policy_timeshare_info</strong>.
</dl>
<p>
<dt> <var>thread_info</var> 
<dd>
[out structure]
Information about the specified thread.
<p>
<dt> <var>thread_info_count</var> 
<dd>
[in/out scalar]
On input, the maximum size of the buffer; on output, the 
size returned (in natural-sized units).
</dl>
<h3>DESCRIPTION</h3>
<p>
The <strong>thread_info</strong> function returns an information structure
of type <var>flavor</var>.
<h3>NOTES</h3>
<p>
At any given time, a thread has only one scheduling policy in
effect for it.  Thus, 
only one of the scheduling information structures will be valid,
that so indicated 
by the policy value returned by <strong>THREAD_BASIC_INFO</strong>.
<h3>RETURN VALUES</h3>
<p>
Only generic errors apply.
<h3>RELATED INFORMATION</h3>
<p>
Functions:
<a href="task_info.html"><strong>task_info</strong></a>,
<a href="task_threads.html"><strong>task_threads</strong></a>,
<a href="thread_get_state.html"><strong>thread_get_state</strong></a>,
<a href="thread_set_special_port.html"><strong>thread_set_special_port</strong></a>,
<a href="thread_set_state.html"><strong>thread_set_state</strong></a>.
<p>
Data Structures:
<a href="thread_basic_info.html"><strong>thread_basic_info</strong></a>,
<a href="policy_timeshare_info.html"><strong>policy_timeshare_info</strong></a>,
<a href="policy_fifo_info.html"><strong>policy_fifo_info</strong></a>,
<a href="policy_rr_info.html"><strong>policy_rr_info</strong></a>.
